package com.woniu.repaircenter.service.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.repaircenter.models.dto.RepairLogDTO;
import com.woniu.repaircenter.models.param.InsertRepairLogParam;
import com.woniu.repaircenter.service.model.RepairLog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 维修日志表 Mapper 接口
 * </p>
 *
 * @author 吕雨泽
 * @since 2024年12月06日
 */
@Mapper
public interface RepairLogMapper extends BaseMapper<RepairLog> {

    List<RepairLogDTO> selectRepairLog(@Param("repairNum") String repairNum);

    @Insert("insert into repair_log(repair_num,repair_state,oper_name,oper_user,oper_date,oper_reason) values(#{repairLog.repairNum},#{repairLog.repairState},#{repairLog.operName},#{repairLog.operUser},#{repairLog.operDate},#{repairLog.operReason})")
    Integer insertRepairLog(@Param("repairLog") RepairLog repairLog);


    List<RepairLogDTO> searchRepairLogByRepairNum(@Param("repairNum") String repairNum);
}
